package com.sailorless.luna.graphics 
{
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author Herbs
	 */
	public class SpriteBitch 
	{
		private var ddraw:BitmapData;
		private var ddrawRect:Rectangle;
		
		public function SpriteBitch(ddraw:BitmapData) 
		{
			this.ddraw = ddraw;
			ddrawRect = ddraw.rect;
		}
		
		public function draw(texture:Texture2D, position:Point, mergeAlpha:Boolean = false):void 
		{
			ddraw.copyPixels(texture.sourceBitmapdata, texture.sourceRectangle, position, null, null, mergeAlpha);
		}
		
		public function clear(color:uint = 0):void 
		{
			ddraw.fillRect(ddrawRect, 0);
		}
		
	}

}